<template>
    <div>
        <ul>
            <li v-for='i in data' @click='setcid(i.id)' :class="i.id==cid?'active':''">{{i.name}}</li>
        </ul>

    </div>
</template>

<script>
    export default {
        props:['data','cid'],
        data(){
            return{
                
            }
        },
        methods: {
        setcid(cid){
            this.cid=cid
            this.$emit('cid',cid)
        }
    },
        mounted() {
            
        },
    }
</script>

<style scoped>
.active{
    background-color: aquamarine;}
</style>